package com.imooc.passbook.log;

import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;


import javax.servlet.http.HttpServletRequest;

/**
 * 日志生成类
 * Created by lzq on 2018/8/31
 */
@Slf4j
public class LogGenerator {

    public static void getLog(HttpServletRequest request, Long userId, String action, Object info){
        log.info(
                JSON.toJSONString( new LogObject(action, userId, System.currentTimeMillis(), request.getRemoteAddr(), info))
        );
    }

}
